package com.speedchina.permission.service.sys;

import com.speedchina.framework.base.IService;
import com.speedchina.permission.domain.sys.dto.ResourceDTO;
import com.speedchina.permission.domain.sys.entity.Resource;
import com.speedchina.permission.domain.sys.entity.User;
import com.speedchina.permission.domain.sys.po.ResourcePo;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 *  服务层接口
 * @author winter
 * @date 2021-04-07 15:19:42
 */
public interface ResourceService extends IService<Resource> {
    /**
     * 查询菜单树
     * @param params
     * @return
     */
    List<ResourceDTO> trees(ResourcePo params);

    /**
     * 查询用户菜单
     * @param user
     * @return
     * @deprecated
     */
    List<ResourceDTO> queryUserMenu(User user);
    /**
     * 查询用户菜单
     * @param user
     * @return
     */
    List<ResourceDTO> queryUserMenuTree(User user);

    /**
     * 查询用户拥有的权限标识
     * @param id
     * @return
     */
    Set<String> getPermissions(String id);

    /**
     * 级联删除资源
     * @param ids
     * @return
     */
    boolean deleteLinkedBatch(List<Serializable> ids);
}
